package com.ssh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.ssh.dao.CategoryDao;
import com.ssh.entity.Category;
import com.ssh.service.CategoryService;

@Service
public class CategoryServiceImpl implements CategoryService {

	@Autowired
	private CategoryDao cd;
	
	@Override
	public String findAll() {
		
		List<Category> list = cd.findAll();
		
		if(list != null && list.size() > 0){
			return JSON.toJSONString(list);
		}
		return null;
	}

}
